package org.example.zpqy.controll;


import org.example.zpqy.bean.CherryOne;
import org.example.zpqy.service.CherryOneService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/cherryone")
public class CherryOneController {
    private final CherryOneService service;
    public CherryOneController(CherryOneService service) {
        this.service = service;
    }

    @GetMapping("/all")
    public List<CherryOne> getAll() {
        return service.findAll();
    }
}